<?php

namespace App\Http\Requests\Api;

class RegisterRequest extends FormRequest
{
    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'email' => 'required|email|unique:users|max:255',
            'password' => 'required|string|min:6',
            'email_code' => 'required|string|max:10',
            'email_key' => 'required|string|max:30',
            'name' => 'required|string|unique:users'
        ];
    }

    public function attributes()
    {
        return [
            'email_code' => '邮箱验证码',
            'email_key' => '邮箱验证令牌',
            'name' => '昵称'
        ];
    }
}
